﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Register.Model;
using Register.IDAL;
using Register.DALFactory;

namespace Register.BLL
{
   public  class RoleBLL
    {
       private static String typeNameKey = "IRoleDALKey";
       public static  List<Role> GetAllRole(string where, int pageIndex, int size)
        {
            IRole irole = DALFactory<IRole>.Create(typeNameKey);
            return irole.GetAllRole(where, pageIndex, size);
        }
        public static  int AddRole(Role role)
        { 
            role.Role_ID = DataIDHelper.GetDataID("Role_ID");
            IRole irole = DALFactory<IRole>.Create(typeNameKey);
            return irole.AddRole(role);
        }
        public static   bool UpdateRole(Role role)
        {
            IRole irole = DALFactory<IRole>.Create(typeNameKey);
            return irole.UpdateRole(role);
        }
        public static   bool DeleteRole(string Role_ID)
        {
           IRole irole = DALFactory<IRole>.Create(typeNameKey);
           return irole.DeleteRole(Role_ID);
        }
        public static int GetRoleCount(string where)
        {
            IRole irole = DALFactory<IRole>.Create(typeNameKey);
            return irole.GetRoleCount(where);
        }
    }
}
